package framework.observer;

import java.util.Observable;
import java.util.Observer;

import framework.BaseManager;
import framework.account.BaseAccount;
import framework.account.Transaction;

public abstract class BaseObserver<T extends BaseAccount, E extends Transaction> implements Observer{

	public BaseObserver(Class<T> clazz){
		BaseManager.getInstance().attachObserver(this,clazz.getName());
	}

	public void update(Observable o, Object arg) {
		T t = (T)o;
		E e = (E)arg;
		updateObserver(t, e);
	}
	public abstract void updateObserver(T t,E e);
}
